From: Robert Lipe Date: Thu, 29 Dec 2016 06:38:24 +0000 (-0500) Subject: Be even more pedantic with QStringLiteral - Make not just the array access, but also... X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~9^2~9^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9e5b2a9dbf0b426c8062cf104662908a0e00cd73;p=gpsbabel.git Be even more pedantic with QStringLiteral - Make not just the array access, but also the value being set a literal. --- diff --git a/geojson.cc b/geojson.cc index b76a4d9ab..5c8fdf491 100644 --- a/geojson.cc +++ b/geojson.cc @@ -50,10 +50,10 @@ static void geojson_waypt_pr(const Waypoint* waypoint) { QJsonObject object; static const QString kType = QStringLiteral("type"); - object[kType] = "Feature"; + object[kType] = QStringLiteral("Feature"); QJsonObject geometry; - geometry[kType] = "Point"; + geometry[kType] = QStringLiteral("Point"); QJsonArray coords; coords.append(waypoint->longitude); @@ -62,7 +62,7 @@ geojson_waypt_pr(const Waypoint* waypoint) { coords.append(waypoint->altitude); } - geometry[kType] = "Point"; + geometry[kType] = QStringLiteral("Point"); geometry[QStringLiteral("coordinates")] = coords; object[QStringLiteral("geometry")] = geometry; @@ -95,7 +95,7 @@ geojson_rd_deinit() { static void geojson_wr_deinit(void) { QJsonObject object; - object[QStringLiteral("type")] = "FeatureCollection"; + object[QStringLiteral("type")] = QStringLiteral("FeatureCollection"); object[QStringLiteral("features")] = *feature_collection; QJsonDocument save(object); @@ -116,7 +116,7 @@ geojson_read(void) { static void geojson_track_hdr(const route_head* track) { track_object = new QJsonObject(); - (*track_object)[QStringLiteral("type")] = "Feature"; + (*track_object)[QStringLiteral("type")] = QStringLiteral("Feature"); track_coords = new QJsonArray(); QJsonObject properties; @@ -139,7 +139,7 @@ static void geojson_track_disp(const Waypoint* trackpoint) { static void geojson_track_tlr(const route_head* track) { QJsonObject geometry; - geometry[QStringLiteral("type")] = "LineString"; + geometry[QStringLiteral("type")] = QStringLiteral("LineString"); geometry[QStringLiteral("coordinates")] = *track_coords; (*track_object)[QStringLiteral("geometry")] = geometry; feature_collection->append(*track_object);